<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Rebate
 *
 * @property int $id
 * @property float $money 分润金额
 * @property int $order_id 订单id
 * @property int $user_id 获得分润的用户id,不是购买用户id。
 * @property string $level 1：一级分润；2：二级分润。
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\Order $order
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereOrderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Rebate whereUserId($value)
 * @mixin \Eloquent
 */
class Rebate extends Model
{
    protected $fillable = ['money','user_id','order_id','level'];

    //分润的订单信息
    function order() {
        return $this->belongsTo('App\Models\Order');
    }
}
